package com.code.day14;

public class Day14Math {
    public static void main(String[] args) {
        //取绝对值
        System.out.println(Math.abs(-10));
        System.out.println(Math.abs(10));
        //向上取整
        System.out.println(Math.ceil(10.1));
        System.out.println(Math.ceil(-5.2));
        //向下取整
        System.out.println(Math.floor(10.4));
        System.out.println(Math.floor(-5.2));
        //四舍五入
        System.out.println(Math.round(10.4));
        System.out.println(Math.round(10.5));
        System.out.println(Math.round(-5.2));
        System.out.println(Math.round(-5.5));
        //最大值和最小值
        System.out.println(Math.max(10,20));
        System.out.println(Math.min(10,20));
    }
}
